"""
截屏，截屏时间作为文件名。
"""
import time
import os


def screenshot(driver):
    # 截屏时间
    screen_time = time.strftime('%Y%m%d%H%M%S', time.localtime(time.time()))
    # 图片名称
    screen_name = os.path.dirname(os.path.abspath('.')) + '\\picture\\screen\\' + screen_time + '.png'
    # 截屏
    driver.get_screenshot_as_file(screen_name)
